package com.example.servletdemo.mvc.controller;

import com.example.servletdemo.mvc.model.Student;
import com.example.servletdemo.mvc.service.impl.StudentServiceImpl;
import com.example.servletdemo.mvc.service.inter.StudentServiceInter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class StudentController {

    @Resource
    StudentServiceInter studentServiceInter;

    @GetMapping("/getUserName")
    public String getUserName(){
        return "hello world";
    }

    @GetMapping("/getStuInfo")
    public Student getStuInfo(int id){
        return studentServiceInter.getStuInfo(id);
    }
}
